package org.ccay.async;

import java.util.Properties;

import kafka.consumer.ConsumerConfig;
import kafka.javaapi.consumer.ConsumerConnector;

/**
 * kafka consumer factory
 * 
 * 
 *
 */
public class KafkaConsumerFactory {
	
	private Properties consumerConfig;
	
	private ConsumerConnector consumer;
	
	public ConsumerConnector createConsumer() {		
		consumer = kafka.consumer.Consumer.createJavaConsumerConnector(new ConsumerConfig(consumerConfig));
		return consumer;		
	}

	public Properties getConsumerConfig() {
		return consumerConfig;
	}


	public void setConsumerConfig(Properties consumerConfig) {
		this.consumerConfig = consumerConfig;
	}

}
